package com.domain;

public class ASDomain{
	private String ASID = "";
	private String ASName = "";
	private String type = "";//"value" or "status"
	private double value = 0;
	private String status = "off";
	private String unit = "";
	public ASDomain() {
		
	}
	public ASDomain(String asid, String asname, String type, double value, String unit){
		this.ASID = asid;
		this.ASName = asname;
		this.type = type;
		this.value = value;
		this.unit = unit;
	}
	
	
	public ASDomain( String asname, String type, double value, String unit){
		this.ASName = asname;
		this.type = type;
		this.value = value;
		this.unit = unit;
	}
	
	public String logBuilder(){
		StringBuilder str = new StringBuilder();
		str.append(ASName);
		if(!this.ASID.equals("")){
			str.append("(");
			str.append(this.ASID);
			str.append(")");
		}
		str.append(" ");
		str.append(this.type);
		str.append(" is ");
		switch(this.getType()){
		case "value":
			str.append(this.value);
			break;
		case "status":
			str.append(this.status);
			break;
		default:
			break;
		}
		str.append(this.unit);
		str.append(".");
		return str.toString();
		
	}
	
	public String getASID() {
		return ASID;
	}
	public void setASID(String aSID) {
		ASID = aSID;
	}
	public String getASName() {
		return ASName;
	}
	public void setASName(String aSName) {
		ASName = aSName;
	}
	public double getValue() {
		return value;
	}
	public void setValue(double value) {
		this.value = value;
	}
	public String getUnit() {
		return unit;
	}
	public void setUnit(String unit) {
		this.unit = unit;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	
	
	
}
